import request from '@/config/axios'

// 排产排产
export interface ProductionVO {
  ordernumber: string // Order number, string type, maximum length 20
  workordernumber: string // Work order number, string type, maximum length 20
  date: Date // Date, date type
  value: number // Value, integer type
}

// Scheduling and production information table API
export const ProductionApi = {
  // 查询Scheduling and production information table分页
  getProductionPage: async (params: any) => {
    return await request.get({ url: `/server/scheduling/production/page`, params })
  },

  // 查询Scheduling and production information table详情
  getProduction: async (id: number) => {
    return await request.get({ url: `/server/scheduling/production/get?id=` + id })
  },

  // 新增Scheduling and production information table
  createProduction: async (data: ProductionVO) => {
    return await request.post({ url: `/server/scheduling/production/create`, data })
  },

  // 修改Scheduling and production information table
  updateProduction: async (data: ProductionVO) => {
    return await request.put({ url: `/server/scheduling/production/update`, data })
  },

  // 删除Scheduling and production information table
  deleteProduction: async (id: number) => {
    return await request.delete({ url: `/server/scheduling/production/delete?id=` + id })
  },

  // 导出Scheduling and production information table Excel
  exportProduction: async (params) => {
    return await request.download({ url: `/scheduling/production/export-excel`, params })
  }
}
